package com.sdy.healthcode.web.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sdy.healthcode.biz.dto.PersonnelEntryAndExitDTO;
import com.sdy.healthcode.biz.model.ReportPeopleClock;
import com.sdy.healthcode.biz.service.ReportPeopleClockService;
import com.sdy.common.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sdy.mvc.controller.BaseController;
import java.util.List;

/**
 * <p>
 * 本院人员健康打卡情况分析 前端控制器
 * </p>
 *
 * @author cgj
 * @since 2020-03-02
 */
@Slf4j
@RestController
@Api(tags = "本院人员健康打卡情况")
@RequestMapping("/reportPeopleClock")
public class ReportPeopleClockController extends BaseController {
    @Autowired
    private ReportPeopleClockService reportPeopleClockService;

    @GetMapping("/getRpPeooleClock")
    @ApiOperation(value = "人员进出情况分析数据表" , response = ReportPeopleClock.class)
    public Response<List<ReportPeopleClock>> getRpPeooleClock(){

        List<ReportPeopleClock> list = reportPeopleClockService.list(Wrappers.<ReportPeopleClock>lambdaQuery()
                .orderByDesc(ReportPeopleClock::getRecordDate).last("limit 14"));
        return Response.success(list);
    }
}
